//
//  MsgHeadView.m
//  CheckInforDemo
//
//  Created by bob on 2017/9/26.
//  Copyright © 2017年 bob. All rights reserved.
//

#import "MsgHeadView.h"


@implementation MsgHeadView

-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    if (self=[super initWithReuseIdentifier:reuseIdentifier]) {
    
        self.contentView.backgroundColor=[UIColor colorWithRed:234/255.0 green:234/255.0 blue:234/255.0 alpha:1.0];
        
        self.TimeLabel=[[UILabel alloc]initWithFrame:CGRectMake(0, 10, 100, 21)];
        
        self.TimeLabel.textAlignment=NSTextAlignmentCenter;
        
        self.TimeLabel.layer.cornerRadius=2.0;
        
        self.TimeLabel.layer.masksToBounds=YES;
        
        self.TimeLabel.backgroundColor=[UIColor colorWithRed:193/255.0 green:193/255.0 blue:193/255.0 alpha:1.0];
        
        self.TimeLabel.textColor=[UIColor whiteColor];
        
        self.TimeLabel.font=[UIFont systemFontOfSize:13];
        
        [self.contentView addSubview:self.TimeLabel];

    }
    return self;
}


-(void)setTimeStr:(NSString *)timeStr
{
    _timeStr=timeStr;
    self.TimeLabel.text=timeStr;
    
    [self.TimeLabel sizeToFit];
    
    self.TimeLabel.frame=CGRectMake((SCREEN_WIDTH-self.TimeLabel.frame.size.width-10)/2.0, (41-self.TimeLabel.frame.size.height-5)/2.0+3, self.TimeLabel.frame.size.width+10, self.TimeLabel.frame.size.height+5);
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
